package com.moyun.search.controller;

import com.moyun.search.common.base.BaseController;
import com.moyun.search.common.result.Result;
import com.moyun.search.service.ProjectCategoryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 项目分类接口
 * @author: zealon
 * @since: 2021/12/24
 */
@RequestMapping("project-category")
@RestController
public class ProjectCategoryController extends BaseController {

    @Autowired
    private ProjectCategoryService projectCategoryService;

    @GetMapping("list")
    public Result getCategoryList(Integer parentId) {
        if (parentId == null) {
            parentId = 0;
        }
        return this.projectCategoryService.getCategoryList(parentId);
    }
}
